<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String root = request.getContextPath();
String filesInfo=(String)request.getAttribute("filesInfo");
if(filesInfo==null || "".equals(filesInfo.trim())){
	filesInfo="[]";	
}
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'upload.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript"
			src="<%=root%>/scripts/jquery-1.3.2.min.js"></script>
	<script type="text/javascript">
	<!--
	
		function fileChange(e){
				var newFileInput=$('#single_file').clone(true)
				newFileInput.insertAfter($(this).parent());
				$(this).unbind();
				$(':file',newFileInput).attr('name',new Date());
				$(':file',newFileInput).val('');
				$(':file',newFileInput).change(fileChange);
		}
		
		$(function(){
			$("#submit_files").click(function(){
				if(window.parent!=undefined){
					window.parent.showProcessbar();
				}	
				$("#files_form").submit();
			});
			$(':file').change(fileChange);
			if(window.parent!=undefined){
				var filesInfo=eval("("+"<%=filesInfo%>"+")");
				window.parent.showFilesInfo(filesInfo);
			}
		});
	-->
	</script>
  </head>
  
  <body>
    <form id="files_form" action="<%=root%>/admin/fileUpload" method="post" enctype="multipart/form-data">
    	<input type="hidden" value="ddd" name="respository"/>
    	<div id="single_file"><input style="border:0px" type="file" name="upload" size="20"/></div>
    	<input type="button" id="submit_files" value="上传" />
    </form>
  </body>
</html>
